<template>
    <div class="search-input-component">
    	<h3>快捷查询</h3>
		<Row class-name="input-label" :gutter="30">
			<Col span="4">优惠类型</Col>
			<Col span="4">优惠名称</Col>
			<Col span="4">申请人</Col>
			<Col span="6">可用业务</Col>
			<Col span="4"></Col>
		</Row>
	   <Row :gutter="30">
			<Col span="4"> <Input size="large" placeholder="请输入优惠类型"  ></Input></Col>
			<Col span="4"> <Input size="large" placeholder="请输入优惠名称"></Input></Col>
			<Col span="4"> <Input size="large" placeholder="请输入申请人"></Input></Col>
			<Col span="6"> <Cascader size="large" :data="data4" :load-data="loadData"></Cascader></Col>
			<Col span="4"> <Button type="primary">查询</Button></Col>	   	
	   </Row>
    </div>
</template>

<script>
    export default {
        data () {
            return {
                data4: [
                    {
                        value: 'beijing',
                        label: '北京',
                        children: [],
                        loading: false
                    },
                    {
                        value: 'hangzhou',
                        label: '杭州',
                        children: [],
                        loading:false
                    }
                ]
            }
        },
        methods: {
            loadData (item, callback) {
                item.loading = true;
                setTimeout(() => {
                    if (item.value === 'beijing') {
                        item.children = [
                            {
                                value: 'talkingdata',
                                label: 'TalkingData'
                            },
                            {
                                value: 'baidu',
                                label: '百度'
                            },
                            {
                                value: 'sina',
                                label: '新浪'
                            }
                        ];
                    } else if (item.value === 'hangzhou') {
                        item.children = [
                            {
                                value: 'ali',
                                label: '阿里巴巴'
                            },
                            {
                                value: '163',
                                label: '网易'
                            }
                        ];
                    }
                    item.loading = false;
                    callback();
                }, 1000);
            }
        }
    }
</script>

<style scoped>

  .search-input-component{
  	margin:15px 0;
  }

  .input-label{
  	margin: 15px 0 10px 0;
  }
</style>

